import { request } from '@/apis';
import { addPrefix } from '@/utils/helper';
import { type GreenManufacturingParams } from './types';

const prefixUrl = '/ep-query';

const Api = {
  /** 认定级别 */
  greenCertificationDepartment: '/screen/greenCertificationDepartment',
  /** 产品类别 */
  greenDesignCategory: '/screen/greenDesign/category',
  /** 认定批次 */
  greenDesignBatch: '/v2/screen/pcGreenDesignBatch',
  /** 细分行业 */
  productType: '/screen/industrialProductsGreenDesign/productType',
  /** 数据 */
  getHbSubject: '/v2/hbSubject/getHbSubject'
};

addPrefix(Api, prefixUrl);

export * from './types';

/** 获取认定级别 */
export const getGreenCertificationDepartment = (type: string) => request.get({ url: Api.greenCertificationDepartment, params: { type } });

/** 获取产品类别 */
export const getIndustryCategory = () => request.get({ url: Api.greenDesignCategory });

/** 获取认定批次 */
export const greenDesignBatch = () => request.get({ url: Api.greenDesignBatch });

/** 获取细分行业 */
export const getProductType = () => request.get({ url: Api.productType });

/** 获取表格数据 */
export const getHbSubject = (params: GreenManufacturingParams) => request.get({ url: Api.getHbSubject, params });
